Added centroid processing