Adapting for running on Mac OS X