initial code import for medoid clustering