Committing exercise 6 from chapter 6.