getVelocities function added