finish chapter6 exercise