updated with Haskell goodness