solved problem A.