Mirror main's structure support, along with new functions