Update maxDifference