         /******       APPROX          ******/
         /***********************************/
 
-        n_total = calc_prefix<DIM2>(prefix, tid,  1 - (split || !use_node));
+        n_total = calc_prefix<DIM2>(prefix, 1 - (split || !use_node));
         offset = prefix[tid];
 
         if (!split && use_node) approxM[n_approx + offset - 1] = node;

          __syncthreads();

          // step 2:
          const int nl = inclusive_segscan_array<DIM2>(&body_list[n_direct], nb, tid);
          nb = directM[prefix[nl_pre + nl - 1]];                       // number of bodies stored in these leaves
          __syncthreads();


}
#else
  template<int DIM2>
__device__ __forceinline__ int calc_prefix(int* prefix, int value) 
{
    return calc_prefix1<DIM2>(prefix, value);
}
#endif


  template<int DIM2>
__device__ int calc_prefix(int N, int* prefix_in) 
{
  const int DIM = 1 << DIM2;

  int y = calc_prefix<DIM2>(prefix_in, prefix_in[tid]);
  if (N <= DIM) return y;

  for (int p = DIM; p < N; p += DIM) 
  {
    int *prefix = &prefix_in[p];
    const int y1 = calc_prefix<DIM2>(prefix, prefix[tid]);
    prefix[tid] += y;
    y += y1;
  }
