Fixed bug from chapter 10