Haskell problem 7 complete.
Some tidying.