tweak getCentroid, modify getCanonicalRep so that it takes in data model, add to tests