Updated to run on OSX