Working example

The example is now working. Code has been refined and some functionality
added.