mostly compiles on osx now