Fixing bug in the example and consolidating it.
Merge pull request #10 from nathanathan/patch-2

Fixing bug in the example and consolidating it.