first working iteration of spectral residual