added sorting debug