(*) GetSortedEndPoints: added a check for unsorted min endpoints