add chapter 5 code sample