Added answer to problem 5 by haskell