solve exercises 4.38 - 4.42