 				cuda_hostRight(cl,rbf, qp) = in_c_r_p(cl,rbf,qp);
 				omp_hostRight(cl,rbf,qp) = in_c_r_p(cl,rbf,qp);
 
-				cudaRight[cl * p * r + rbf * p + qp] = in_c_r_p(cl,rbf,qp);
+				cudaRight[cl * p * r + r * qp + rbf] = in_c_r_p(cl,rbf,qp);
 			}
 			for(int lbf = 0; lbf < l; ++lbf) {
 				cuda_hostLeft(cl, lbf, qp) = in_c_l_p(cl,lbf, qp);
 				omp_hostLeft(cl,lbf, qp) = in_c_l_p(cl,lbf,qp);
 
-				cudaLeft[cl * p * l + lbf * p + qp] = in_c_l_p(cl,lbf,qp);
+				cudaLeft[cl * p * l + l * qp + lbf] = in_c_l_p(cl,lbf,qp);
 			}
 			//cudaRightColMajor[cl + c*qp] = in_r_c_p(cl,qp);
 			//cudaLeftColMajor[cl + c*qp] = in_l_c_p(cl,qp);


		double temp = 0;
		for (int qp = 0; qp < numPoints; qp++) {
			temp += d_left[myMatrix*numPoints*numLeftFields + matrixRow*numPoints + qp] *
							d_right[myMatrix*numPoints*numRightFields + matrixCol*numPoints + qp];
		}
		d_out[myID]= temp;
	}



int main(int argc, char* argv[]) {
	int c=10000, p=10, l=10, r=10;

	FieldContainer<double> in_c_l_p(c, l, p);
	FieldContainer<double> in_c_r_p(c, r, p);
