Added code snippet for chapter 3