tidy up and haskell