After chapter 6 (copied code from book source code repo)