Minor code cleanup
Calculate velocities.