Adding spectral clustering to sim.py