Code to generate a dendrogram from a dataset