Committing exercise 16 from chapter 6.