Solved exercises 3.25 to 3.29