solve exercises 4.22 - 4.25