solve exercises 7.31 - 7.34