OSX support added, and first working example