move joystick funcitons to another file