adding kmeans, distance helper and preprocess