Added the solution to exercise 3.14