modified joystick code for better control