Sample Application updated

I've done some modifications to the sample app, including some new blocks of code to implement features that were on hold. I'm submitting this under your evaluation. Thanks