imported chapter 23 sample code