added comments, modified getSpectrum(y)