The mainloop should be integreated now.