Merge new state machine into master