 } 
 
 template<int DIM2>
-__device__ int calc_prefix(int* prefix, int tid, int value) {
+__device__ int calc_prefix1(int* prefix, int tid, int value)
+{
   int  x;
-  
+
   const int DIM = 1 << DIM2;
 
   prefix[tid] = value;

          __syncthreads();

          //step 2:
#ifdef OLDPREFIX
          int nl = calc_prefix<DIM2>(nb, &body_list[n_direct], tid);
#else
          int nl = inclusive_scan_array<ADDOP<int>, int>              // inclusive scan to compute number of leaves to process
            (&body_list[n_direct], nb, tid);            // to make sure that there is enough shared memory for bodies
#endif
          nb = directM[prefix1[nl_pre + nl - 1]];                        // number of bodies stored in these leaves

          // step 3:
          for (int i = n_direct; i < n_direct + nb; i += DIM) {          //segmented fill of the body_list


  float  *node_mon0 = sh_mass;
  float3 *node_mon1 = sh_pos; 

  float  *sh_pot = sh_mass;
  float3 *sh_acc = sh_pos;

