debug sort