New clustering logic v.6