99haskell problems 8, 9