Prelim function for sorting routes (trying to improve matching).