Added answer to problem 9 by haskell