commented out the centroid functionality as it is not used and its a performance hog