debug the sorting methods