finished clustergram function