increased commenting of essential functions having to do with k-means clustering.