Changes to state manager, now has FLAGS