finish debug sorting, finalize sort!