Made the getSpectrum function play nicely to return the spectrum parameters, but still not plotting properly