Multi-layer clustering logic
Merge branch 'master' into gh-pages