add solution of problem 6.16