exercise 1 from chap 2