solve problem 4