Added an input handler
Integrated the InputHandler and changed the way the thread closing works
Updated the main