Completed code through Chapter 3 in book.