finished the third problem, untested