The clusterize function that beats the baseline