improved gravity and added joystick support