Code examples from chapter 1