Added a state machine example.