finished converting examples from chapter 10