initial typechecking code, joystick support