Exercise 21.
Extend ex21 a bit.