modify getCentroid so that it can take in different comparators, fix errors in getCentroid & getCanonicalRep, break centroid ties