Add conditional code to handle differences between 10.8 and 10.9

Hi!  I added some conditional code to check for 10.8 and 10.9.  I did not test this on 10.8 as I do not have a 10.8 Retina MacBook Pro.  Please feel free to use as however you see fit.