             body_force[ilocal].z = fi.z;
             body_force[ilocal].w = fi.w;
             
-            /*
-            ri.x = pos.x - com.x;
-            ri.y = pos.y - com.y;
-            ri.z = pos.z - com.z;
-            
-            float x_shift = rintf(ri.x * box.Lxinv);
-            ri.x -= box.Lx * x_shift;
-            float y_shift = rintf(ri.y * box.Lyinv);
-            ri.y -= box.Ly * y_shift;
-            float z_shift = rintf(ri.z * box.Lzinv);
-            ri.z -= box.Lz * z_shift;
-            
-            if (ri.x >= box.Lx/2.0) ri.x -= box.Lx;
-            else if (ri.x <= -box.Lx/2.0) ri.x += box.Lx;
-            if (ri.y >= box.Ly/2.0) ri.y -= box.Ly;
-            else if (ri.y <= -box.Ly/2.0) ri.y += box.Ly;            
-            if (ri.z >= box.Lz/2.0) ri.z -= box.Lz;
-            else if (ri.z <= -box.Lz/2.0) ri.z += box.Lz;
-            */
-            
+                     
             // This might require more calculations but more stable
             ri.x = ex_space.x * particle_pos.x + ey_space.x * particle_pos.y 
                     + ez_space.x * particle_pos.z;

                                                                                             nmax,
                                                                                             window_size,
                                                                                             box);
    else gpu_rigid_force_sliding_kernel<<< force_grid, force_threads, 2 * window_size * sizeof(float4) >>>(rigid_data.force, 
                                                                                             rigid_data.torque, 
                                                                                             n_bodies, 
                                                                                             local_beg,
                                                                                             nmax,
                                                                                             window_size,
                                                                                             box);       
    if (!g_gpu_error_checking)
        {
        return cudaSuccess;
        }

                                                 unsigned int window_size,
                                                 gpu_boxsize box)
    {
/*	
    int idx_particle = blockIdx.x * blockDim.x + threadIdx.x;
    int idx_body = blockIdx.x + local_beg;
    
