updated mainLoop stub