made corrections to state machines