solve exercises 5.7 - 5.10