fixed up osx compiling. Added more exporting