Update compare function for the route sort