created HandleInput class and updated the engine.