debug sorting