solve exercises 3.16 - 3.20