modifying original kclustering.py to get to work