Adds the main loop to keep running