small changes to update the velocity