Committing exercise 14 from chapter 6.