Finishes chapter 7 code