New hierarchical clustering implementation