Commiting exercise 6 from chapter 4.