Added code for Chapter 18