osx version of the script