Initial implementation of clustering.
typo fix