Committing exercise 12 from chapter 6.