added example for global state
Merge pull request #8 from tauli/master

added example for global state