remove unnecessary swapping in handling velocities