solved Problem A.