Sort by rank if possible