added solution to Exercise 4.14(a)