Implemented optional calculation of clusters via median instead of means.