Adding exercise 5 from chapter 2.