ad hoc addition for output using wavelength - make more general!