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.