updated to use hierarchical k-means (speed up run-time)