solve exercises 12.6 - 12.8