Added answer to problem 7 by haskell