Edits to Chapter 4, along with accompanying example code.