Added code to manage ordering of spectra in array

So that items are added in the correct order when List.Add is used