Added exercise 3 from chapter 7