solve exercises 7.20 - 7.22