mid hard state machine using switch block