Made the code based on the example doc
Merge pull request #6 from Cryde/code-for-example

Made the code based on the example doc