solve problem 3