added comments to source file
Rebased code from sample app into build src