solve exercises 5.30 - 5.32