Improved debug output. Sorted in original order.