working on new state machine representation