Chapter 12 exercises done.

Does the job and is nice and readable.  Would start to look a bit shonky if we were to extend it to add another half a dozen checks, though.