     
     __syncthreads();
     
+    // compute the number of windows that we need to loop over
     unsigned int n_windows = nmax / window_size;
     if (n_windows == 0)
         n_windows = 1;

                                                 unsigned int n_bodies_per_block,
                                                 gpu_boxsize box)
    {
    unsigned int m = threadIdx.x / (blockDim.x / n_bodies_per_block);
    
    float3 *body_force = sum;
    float3 *body_torque = &sum[blockDim.x];
        
    __shared__ float4 ex_space[8], ey_space[8], ez_space[8];
    float3 sum_force = make_float3(0.0f, 0.0f, 0.0f);
    float3 sum_torque = make_float3(0.0f, 0.0f, 0.0f);
    __shared__ int idx_body[8];
    
    if ((threadIdx.x & thread_mask) == 0)
        {
        int group_idx = blockIdx.x*n_bodies_per_block + m;
        if (group_idx < n_group_bodies)
            {

                        + ez_space[m].y * particle_pos.z;
                ri.z = ex_space[m].z * particle_pos.x + ey_space[m].z * particle_pos.y 
                        + ez_space[m].z * particle_pos.z;
                
                // tally the torque in the per thread counter
                sum_torque.x += ri.y * fi.z - ri.z * fi.y;
                sum_torque.y += ri.z * fi.x - ri.x * fi.z;
                sum_torque.z += ri.x * fi.y - ri.y * fi.x;
