added mac osx implementation
exception handling
Merge pull request #4 from codingday/master

added mac osx implementation