problem 5, haskell