Convert more stuff over to haskell.