Starting main loop