Added example for state machine