solve exercises 18.20 - 18.21