Chapter 3 through exercise 23