Solve problem 4