Revert "merge sorting fix patch"

This reverts commit efd8c68128b3b24ecdb9f6070c0bfe0c3c2e1718.
STL's sort to the rescue