Added clustering algorithm