Fixed figure 3 code, chapter 5