     c.w =   b.x * a.z + a.x * b.z - a.y * b.y;
     }
 
-/* Normalize a quaternion
+/*! Normalize a quaternion
+    \param q Quaternion to be normalized
  */
 
 __device__ void normalize(float4 &q)

    angvel.z = angbody.x * ex_space.z + angbody.y * ey_space.z + angbody.z * ez_space.z;
    }

/* Quaternion multiply: c = a * b where a = (0, a)
 */

__device__ void multiply(float4& a, float4& b, float4& c)

    cudaError_t error = cudaBindTexture(0, rigid_data_com_tex, rigid_data.com, sizeof(float4) * n_bodies);
    if (error != cudaSuccess)
        return error;
    
    error = cudaBindTexture(0, rigid_data_particle_indices_tex, rigid_data.particle_indices, sizeof(unsigned int) * n_bodies * nmax);
    if (error != cudaSuccess)
        return error;    
    
    // bind the textures for particles
    error = cudaBindTexture(0, pdata_pos_tex, pdata.pos, sizeof(float4) * pdata.N);
    if (error != cudaSuccess)
