corrected sample problem 9