Spectrum reduce

Draft of code to spectrum reduction via intgration
Add logic to flip arrays that are monotonic down