solve exercises 3.6 - 3.7