mage loop