some of the preliminary stuff for challenge 13
more preliminary stuff
challenge 13

this was remarkably easy to code :-|