added a main loop!