Added debug info for sorting