solution to Exercise 2.5 (b)