state machine logic and design 1112700