designing state machines 2720709