Committing exercis 10 from chapter 7.