fixed k-medoids bugs