         /******       APPROX          ******/
         /***********************************/
 
-#ifdef OLDPREFIX
         n_total = calc_prefix<DIM2>(prefix, tid,  1 - (split || !use_node));
-#else
-        inclusive_scan_block<ADDOP<int>, int>(prefix, 1 - (split || !use_node), tid);
-        n_total = prefix[blockDim.x - 1];
-#endif
-
-
-        // 	n_total = calc_prefix<DIM2>(prefix, tid,  !split && use_node);         // for some unkown reason this does not work right on the GPU
-        if (!split && use_node) approxM[n_approx + prefix[tid] - 1] = node;
+        offset = prefix[tid];
+
+        if (!split && use_node) approxM[n_approx + offset - 1] = node;
         __syncthreads();
         n_approx += n_total;
 


  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];
  
  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;

         ***/


        int n_total = calc_prefix<DIM2>(prefix, tid,  nchild);              // inclusive scan to compute memory offset of each child (return total # of children)
        int offset  = prefix[tid];
        offset     += n_offset - nchild;                                  // convert inclusive into exclusive scan for referencing purpose
        __syncthreads();                                                   // thread barrier

        for (int i = n_offset; i < n_offset + n_total; i += DIM)         //nullify part of the array that will be filled with children
          nodesM[tid + i] = 0;                                          //but do not touch those parts which has already been filled
