added kmeans for clustering codebook