   return y;
 }
 
-
-#endif
 
 /*********** Forces *************/
 



        for (int i = n_offset; i < n_offset + n_total; i += DIM)         //nullify part of the array that will be filled with children
          nodes[tid + i] = 0;                                          //but do not touch those parts which has already been filled
        __syncthreads();                                                 //Thread barrier to make sure all warps finished writing data

        bool flag = (split && !leaf) && use_node;                        //Flag = use_node + split + not_a_leaf;Use only non_leaf nodes that are to be split
        if (flag) nodes[offset] = child;                            //Thread with the node that is about to be split
                                                                         //writes the first child in the array of nodes
        /*** in the following 8 lines, we calculate indexes of all the children that have to be walked from the index of the first child***/
        if (flag && nodes[offset + 1] == 0) nodes[offset + 1] = child + 1; 
        if (flag && nodes[offset + 2] == 0) nodes[offset + 2] = child + 2;
        if (flag && nodes[offset + 3] == 0) nodes[offset + 3] = child + 3;
        if (flag && nodes[offset + 4] == 0) nodes[offset + 4] = child + 4;
        if (flag && nodes[offset + 5] == 0) nodes[offset + 5] = child + 5;
        if (flag && nodes[offset + 6] == 0) nodes[offset + 6] = child + 6;
        if (flag && nodes[offset + 7] == 0) nodes[offset + 7] = child + 7;
        __syncthreads();

        n_offset += n_total;    //Increase the offset in the array by the number of newly added nodes

         ***/

        /*** if half of shared memory or more is filled with the the nodes, dump these into slowmem stack ***/
        while(n_offset >= DIM) 
        {
          n_offset -= DIM;
          const int offs1 = ACCS<SHIFT>(n_stack1);
          nstack[offs1] = nodesM[n_offset + tid];   n_stack1++;
          n_nodes1 += DIM;

          if((n_stack1 - c_stack0) >= (LMEM_STACK_SIZE << SHIFT))
