Finished the third problem