updates for MacOSX and Linux compatibility