moved agglomeration to the end (where there are less samples)