solve exercises 5.24 - 5.29