         body_list[tid] = directM[tid];                                            //copy list of bodies from previous pass to body_list
 
         // step 1
-        calc_prefix<DIM2>(prefix, tid, flag);                                // inclusive scan on flags to construct array
+        calc_prefix<DIM2>(prefix, flag);                                // inclusive scan on flags to construct array
         const int offset1 = prefix[tid];
         
         // step 2
-        int n_bodies  = calc_prefix<DIM2>(prefix, tid, nbody);              // inclusive scan to compute memory offset for each body
+        int n_bodies  = calc_prefix<DIM2>(prefix, nbody);              // inclusive scan to compute memory offset for each body
         offset = prefix[tid];
         __syncthreads();
 

      int direCount = 0;


      acc_i = approximate_gravity<blockDim2, 0>( DIM2x, DIM2y, tid, tx, ty,
          body_i, pos_i, group_pos,
          eps2, node_begend,
          multipole_data, body_pos,


/****** KEPLER __shfl prefix sum ******/

#if 1  /* uses inlined assembly */
__device__ __forceinline__ uint shfl_scan_add_step(uint partial, uint up_offset)
{
  uint result;
