bunch of cleanup. lots of haddock comments