Added the solution to exercise 3.2.