K-medoids bug fixed. Speed improved.