New clustering logic v.4