update: compute distance function
update: removed bugs, clustering using sklearn