Exercise 1.29 in J