 
   int *directS = shmem;                              //  0*DIM,  1*DIM,  1*DIM
   int *nodesS  = directS + DIM;                      //  1*DIM, 10*DIM,  9*DIM
-  int *prefix  = nodesS  + DIM*9;                    // 10*DIM, 12*DIM,  2*DIM
-  
-  int *prefix0 = &prefix[  0];
-  int *prefix1 = &prefix[DIM];
-  
+  int *prefixS = nodesS  + DIM*9;                    // 10*DIM, 12*DIM,  2*DIM
+
+  int *prefix  = prefixS;
+  int *prefix0 = prefixS;
+  int *prefix1 = prefixS + DIM;
+
   const int NJMAX = DIM*3;
   int    *body_list = (int*   )&nodesS   [  DIM]; //  2*DIM,   5*DIM,  2*DIM
   float  *sh_mass   = (float* )&body_list[NJMAX]; //  5*DIM,   6*DIM,  1*DIM
   float3 *sh_pos    = (float3*)&sh_mass  [  DIM]; //  6*DIM,   9*DIM   3*DIM
   int    *sh_body   = nodesS + DIM*8;             //  9*DIM,  10*DIM,  1*DIM
-  
+
   int *approxM = approxL;
   int *directM = directS;
   int * nodesM =  nodesS;

  __syncthreads();
  return x;
#else
  
  int offset = 0;
  int tid2 = tid << 1;


    int iflag = BTEST(tid < d);
    int ai = (((tid2 + 1) << offset) - 1) & iflag;
    int bi = (((tid2 + 2) << offset) - 1) & iflag;

    prefix[bi] += prefix[ai] & iflag;
    offset++;
  }
