update solution of problem 6.9