finished ch 9 exercise