advanced in mainLoop