DO NOT MERGE: debug for dn sorting algorithm