solve problem 7