Completed exercise 3.29