added gravity, fixed pauses when reversing direction