1. added connectedComponentsWithStats
2. added clustering code