Improved example

The example cause many errors for me. I've updated it to reflect the changes I had to make in order to get it working.
Merge pull request #1 from c316/patch-2

Improved example