         if((n_stack1 - c_stack0) >= (LMEM_STACK_SIZE << SHIFT))
         {
           //We overwrote our current stack
-	  apprCount = -1; return acc_i;	 
-	}
+          apprCount = -1; return acc_i;	 
+        }
       }
       __syncthreads();
 
 
       /***
-      **** --> copy nodes1 to nodes0: done by reassigning the pointers
-      ***/
+       **** --> copy nodes1 to nodes0: done by reassigning the pointers
+       ***/
       n_nodes0    = n_nodes1;
 
       n_stack_pre = n_stack0;


      float4 posj = body_pos[direct[tid]];

  //     float4 posj  = tex1Dfetch(texBody, direct[tid]);
      sh_mass[tid] = posj.w;
      sh_pos [tid] = make_float3(posj.x, posj.y, posj.z);
      sh_jid [tid] = direct[tid];

      #ifdef INDSOFT
        sh_eps [tid] = body_vel[direct[tid]].w;
      #endif
    } else {
      sh_mass[tid] = 0.0f;
      sh_pos [tid] = make_float3(1.0e10f, 1.0e10f, 1.0e10f);
      sh_jid [tid] = -1;

      #ifdef INDSOFT
        sh_eps [tid] = 0.01f;
      #endif
    }

    __syncthreads();
  #pragma unroll
    for (int j = 0; j < DIMx; j++) {
      if ((sh_jid[offs + j] >= 0)) {
        int selfGrav = (body_i != sh_jid[offs + j]);
        float ds2 =  1.0e10f;
        direCount++;
  #ifdef DOGRAV
        #ifdef INDSOFT
          acc_i = add_acc(acc_i, pos_i, sh_mass[offs + j], sh_pos[offs + j], sh_eps[offs + j], ds2, eps2, selfGrav);
        #else
          acc_i = add_acc(acc_i, pos_i, sh_mass[offs + j], sh_pos[offs + j], ds2, eps2, selfGrav);
        #endif
  #endif
        ds2 += selfGrav*1.0e10f;
        if (ds2 < ds2_min) {
          ngb     = sh_jid[offs + j];


  if(n_approx > 0)
  {
#ifdef INDSOFT
    float temp = node_eps[tid];
#endif

    if (tid < n_approx) {
      int address      = (approx[tid] << 1) + approx[tid];
#ifndef TEXTURES
      float4 monopole  = multipole_data[address    ];
      float4 octopole0 = multipole_data[address + 1];
      float4 octopole1 = multipole_data[address + 2];
#else
      float4 monopole  = tex1Dfetch(texMultipole, address);
      float4 octopole0 = tex1Dfetch(texMultipole, address + 1);
      float4 octopole1 = tex1Dfetch(texMultipole, address + 2);
#endif

      node_mon0[tid] = monopole.w;
      node_mon1[tid] = make_float3(monopole.x,  monopole.y,  monopole.z);
      node_oct0[tid] = make_float3(octopole0.x, octopole0.y, octopole0.z);
      node_oct1[tid] = make_float3(octopole1.x, octopole1.y, octopole1.z);

#ifdef INDSOFT
      node_eps[tid]  = octopole0.w;
#endif

    } else {
      //Set non-active memory locations to zero
