Finished third problem and minor clean on the (still) hackish main method.