almost done tertiary clustering