working through examples in the end of chapter 3