Replaced IntegerPair with Pair<Integer, Integer>