centroid calculation in the works