added input and game loop