Improved the InputManager