Added better solution to problem 31 in haskell.