Update code sample for chapter 9.