updated to compile with osx