Merge pull request #3 from amitmula/master

initial commit
added some logging and refactored global variables