Finish exercise 3.5.2 (p152)