add problem 30 in haskell - that took sometime!