Update code example for chapter 4.2