Move flag positions up to use global flags
Prepare new functions