added advanced clustering