solve exercises 3.31 - 3.35