solved problem B.