changing order in mainTick()