added keyboard input and game state