Completed through exercise 3.11