modified spectral algorithm