Solution for Exercise 1.7