Changed to use natural sort order instead of lexicographical order