Began mainloop.