Improved version of KMeans clustering algorithm