Exercise 1-18 from chapter 1 done.