coded two more examples from chapter 3