Add state machine example