completed Exercise 5.12