Committing exercise 11 from chapter 6.