imported sample code for chapter 22