Moved the main loop so the GUI will open