update states example to include state machine macro