added comments on mainjs and demoView; refactored code
Merge pull request #46 from theamarpatel/master

added comments on mainjs and demoView; refactored code