Implemented the getClusters function