Added exercise 2 from chapter 7