Immutable Pair + 2 algorithms