Solve Exercise 3.24