Updates to Chapter 6 code