 cudaError_t gpu_nph_rigid_step_two( const gpu_rigid_data_arrays& rigid_data,
                                     unsigned int *d_group_members,
                                     unsigned int group_size,
-                                    float4 *d_net_force,
-                                    float *d_net_virial,
+                                    Scalar4 *d_net_force,
+                                    Scalar *d_net_virial,
                                     const BoxDim& box, 
                                     const gpu_npt_rigid_data& npt_rdata,
-                                    float deltaT)
+                                    Scalar deltaT)
     {
     unsigned int n_bodies = rigid_data.n_bodies;
     unsigned int n_group_bodies = rigid_data.n_group_bodies;

        {
        oldlo = lo.z;
        oldhi = hi.z;
        ctr = 0.5f * (oldlo + oldhi);
        lo.z = (oldlo - ctr) * npt_rdata_dilation + ctr;
        hi.z = (oldhi - ctr) * npt_rdata_dilation + ctr;
        L.z = hi.z - lo.z;
        }

    // convert rigid body COMs back to box coords
    float3 newboxlo = -L/2.0f;
    pos = L * pos + newboxlo;

    // write out results
    rdata_com[idx_body] = make_float4(pos.x, pos.y, pos.z, 0.0f);

    if (idx_body == 0)
        {
        *npt_rdata_new_box = make_float4(L.x, L.y, L.z, 0.0f);
        }
    }


    
    exyzFromQuaternion(orientation, ex_space, ey_space, ez_space);
    
    Scalar dtfm = dt_half / body_mass;
    
    // update the velocity
    Scalar4 vel2;
    vel2.x = scale_t * vel.x + dtfm * force.x;
    vel2.y = scale_t * vel.y + dtfm * force.y;
    vel2.z = scale_t * vel.z + dtfm * force.z;
    vel2.w = 0;
    
    tmp = vel2.x * vel2.x + vel2.y * vel2.y + vel2.z * vel2.z;
    akin_t = body_mass * tmp;
