Script updated to compile on mac os.