Committing exercise 7 from chapter 6.