A Phase State Machine