Added first version of clustering (jsut a prototype that works, need to change many things and actually do the clustering
)