updated for MacOSX