finished ex9.6.1