imported chapter 17 sample code