Committing exercise 6 from chapter 4.