working on find clusters function