Centroid calculations now work