Major refactor.  Works on OSX.