Finalize K-means for appendix