 	unsigned int n_bodies = rigid_data.n_bodies;
 	unsigned int nmax = rigid_data.nmax;
 		
-	// setup the grid to run the rigid body kernel 
-	int body_block_size = 1; // for the initial step of rigid bodies, no need of particle data; each thread takes care of a rigid body
-	dim3 body_grid(n_bodies / body_block_size, 1, 1);	
-	dim3 body_threads(body_block_size, 1, 1);
-		
-	// setup the grid to run the particle kernel 
-	int particle_block_size = nmax; // maximum number of particles in a rigid body: each thread in a block takes care of a particle in a rigid body
-	dim3 particle_grid(n_bodies, 1, 1);	
-	dim3 particle_threads(particle_block_size, 1, 1);
+	// setup the grid to run the kernel 
+	int block_size = nmax; // maximum number of particles in a rigid body: each thread in a block takes care of a particle in a rigid body
+	dim3 grid(n_bodies, 1, 1);	
+	dim3 threads(block_size, 1, 1);
 
 	// bind the textures for rigid bodies: 
 	// body mass, com, vel, angmom, angvel, orientation, ex_space, ey_space, ez_space, body images, particle pos, particle indices, force and torque

			rigid_data.angmom[idx_body] = angmom2;
			rigid_data.angvel[idx_body] = angvel;
			}	
		}
				
	if (idx_body < rigid_data.n_bodies && idx_particle_index != INVALID_INDEX)
		{
		// v_particle = v_com + angvel x xr
		float4 particle_vel;
		particle_vel.x = vel2.x + angvel.y * ri.z - angvel.z * ri.y;
		particle_vel.y = vel2.y + angvel.z * ri.x - angvel.x * ri.z;
		particle_vel.z = vel2.z + angvel.x * ri.y - angvel.y * ri.x;
		particle_vel.w = 0.0;
			
		// write out the results 
		pdata.vel[idx_particle_index] = particle_vel;
		}
			
	}



	float4 vel2 = make_float4(0.0f, 0.0f, 0.0f, 0.0f);
	float4 particle_accel = make_float4(0.0f, 0.0f, 0.0f, 0.0f);
	
	// ri, body_mass and moment_inertia is used throughout the kernel
	if (idx_body < rigid_data.n_bodies)
		{
		ex_space = tex1Dfetch(rigid_data_exspace_tex, idx_body);
