ported dendrogram from alpha version