code up to chapter 12