solve exercises 5.2 - 5.6