First attempt to port to Mac OSX