Completed exercise for chapter 11