   int box
 )
 {
-  __shared__ double shared[24];
+  __shared__ double shared[THREADS_PER_BLOCK/32*3];
   int laneID = threadIdx.x % 32;
   int warpID = threadIdx.x / 32;
   int particleID = blockIdx.x;

#include "CUDAMemoryManager.cuh"
#include "cub/cub.cuh"
#include <vector>

using namespace cub;


  // first thread inside the block will write back to global memory
  __syncthreads();
  if(threadIdx.x == 0) {
    for(int w=1; w<THREADS_PER_BLOCK/32; w++) {
      forceX += shared[w*3+0];
      forceY += shared[w*3+1];
      forceZ += shared[w*3+2];
