Added gamepad code