Exercise 6.2 finished