Andy Bennett's ex2.c (== Chris Swan's original)