properly declare vars to avoid global scope
Merge pull request #1 from jden/fix-var-declaration

properly declare vars to avoid global scope