Fixed centroid subdivision code