Updates to Chapter 1 code