added example of centroid calculation