Committing exercise 5 from chapter 6.