Added setVelocity function.