first attempt
second attempt for hierarchical clustering