Centroid calculation now supports weight!