         v = v*exp_v_fac_thermo;
 
         // write out the results
-        vel.x = v.x;
-        vel.y = v.y;
-        vel.z = v.z;
-
-        d_vel[idx] = vel;
+        d_vel[idx] = make_scalar4(v.x,v.y,v.z,vel.w);
 
         }
     }

        v = v*exp_v_fac_2 + Scalar(1.0/2.0)*deltaT*accel*exp_v_fac*sinhx_fac_v;
        r = r*exp_r_fac_2 + v*exp_r_fac*sinhx_fac_r*deltaT;

        pos.x = r.x;
        pos.y = r.y;
        pos.z = r.z;

        vel.x = v.x;
        vel.y = v.y;
        vel.z = v.z;

        // write out the results
        d_pos[idx] = pos;
        d_vel[idx] = vel;
        }
    }


    // determine which particle this thread works on
    int group_idx = blockIdx.x * blockDim.x + threadIdx.x;

    if (group_idx < group_size)
        {
        unsigned int idx = d_group_members[group_idx];
