fix applied spectroscopy - complete re-write