added initial Mac OS X compatibility