debug sort and move