solve exercises 3.26 - 3.30