solve exercises 7.16 - 7.17