Committing exercise 6 from chapter 5.