Avoid using globals
Merge pull request #6 from KINFOO/local

Avoid using globals