finish exercise 10.5.7