Code to simulate velocities