New sorting function debugging