small tweaks in clustering algo