add support for osx, avoid setting global variables
Merge pull request #4 from jdonaldson/master

add support for osx, avoid setting global variables