Completed through exercise 3.8