start main loop