Add code to sort the target quantities array by chisq