code is much cleaner now. sorting with preserved column rearrangement +
preserved col sorting is ok. some codes might be optimized. filtering
underconstruction.