Make exercise 1.24 a bit neater