Completed both problems