Added a new velocity function