solve exercises 8.2 - 8.5