middle haircut state machine