Code updates to Chapter 7