Adding centroid position calculator