You can just return `ord.compare(kc1._1, kc2._1)` instead of these if statements; it has the same behavior as Comparator.compare.