update solution of problem 7.1