Committing exercise 10 from chapter 6.