Layered K means clustering