Finally fixed the calculateEntropy function and the classify function. Now for optimization and (better ?) data structures and such.