Solve Exercise 3.21