Solve Exercise 3.7 and 3.8