Merge pull request #2 from amitmula/master

initial commit
added logging and refactored the global variables