Start of chapter 1 code.