complete ex9
extra credit for ex9