implement and test mov-avgs function for a collection of centroids