fixed resid.sco ordering