solve exercises 5.37 - 5.39