wip: main loop proc