 		}
 		//p=r+(rsnew/rsold)*p;
 		p[blockIdx.x*blockDim.x + threadIdx.x] = 
-			r[blockIdx.x*blockDim.x + threadIdx.x] + beta[blockIdx.x] * p[blockIdx.x*blockDim.x + threadIdx.x];
+			r[blockIdx.x*blockDim.x + threadIdx.x] + beta[blockIdx.x] * sharedx[threadIdx.x];
 		//__syncthreads();
 	}
 }

		}
		#endif
		//pAp=p'*Ap
		temp = p[blockIdx.x*blockDim.x + threadIdx.x]
				*ap[blockIdx.x*blockDim.x + threadIdx.x];
		temp = blockReduceSum(temp);
		if(threadIdx.x == 0){

	float temp = 0;
	for(int i = 0; i < f; i++)
		//this is math correct and coalesced because A is symmetric
		temp += A[blockIdx.x*f*f + f*i + threadIdx.x]*sharedx[i];
	r[blockIdx.x*blockDim.x + threadIdx.x] = b[blockIdx.x*blockDim.x + threadIdx.x] - temp;
	//p=r;
	p[blockIdx.x*blockDim.x + threadIdx.x] = r[blockIdx.x*blockDim.x + threadIdx.x];
