substitution in the state machine 2 example fixed