remove global variable leak
Merge pull request #32 from pocesar/implicit-globals

code quality improvement