Updated script for OSX.