changed mac specific scripts and changed OS detection to look simpler