       shared_coords[particleID * 3 + 2]);
     double dotsin, dotcos;
     sincos(dot, &dotsin, &dotcos);
-    sumR += gpu_particleCharge[offset_coordinates_index + particleID] * dotsin;
-    sumI += gpu_particleCharge[offset_coordinates_index + particleID] * dotcos;
+    sumR += gpu_particleCharge[offset_coordinates_index + particleID] * dotcos;
+    sumI += gpu_particleCharge[offset_coordinates_index + particleID] * dotsin;
   }
 
   atomicAdd(&gpu_sumRnew[imageID], sumR);

  checkLastErrorCUDA(__FILE__, __LINE__);
  cudaMemcpy(vars->gpu_hsqr[box], hsqr, imageSize * sizeof(double),
             cudaMemcpyHostToDevice);
  checkLastErrorCUDA(__FILE__, __LINE__);

  dim3 threadsPerBlock(256, 1, 1);

  if(imageID >= imageSize)
    return;

  __syncthreads();
  for(int particleID = 0; particleID < numberOfAtoms; particleID++) {
    double dot = DotProductGPU(gpu_kx[imageID], gpu_ky[imageID], gpu_kz[imageID],
