main loop WIP