added tagging function to associate data and centroids