enhanced cluster analysis, fixed bugs