design of state machines 940327