Updated Chapter 1 Code.