Ex1.9

First half of exercise 1.9