ported content from Word doc for hierclust and flatclust