updated to use y_velocity instead of gravity