Added answer to problem 8 and 9 by haskell