solve exercises 6.19 - 6.21