imported chapter 16 sample code