Modified normalize to take list of centroids.