added clustering
Merge with upstream