solved exercises 19 and 20.