Completed code through Chapter 4 in book.