exercise 1-46. Last exercise of chapter 1 :)