main loop now completely async