solution of problem 2