haskell solution for problem6