I understand that first we pick K centroids randomly and then we try to recalculate the new position of centroids so that the sum of distance (error) is minimized. So how do