chapter 3 and 4 -- update to chapter 2