Implement clustering method