solve exercises 20.29 - 20.30