working on converting legacy spectral code to new code
more converting legacy spectral code