add mainloop and adjust systems to work with it