solve exercises 4.9 - 4.13