added logging, refactored global variables
Merge pull request #7 from seshendra/master

added logging, refactored global variables