Change currentDiff to not be a global variable