Implements K-mean clustering

Bug Fix