Added indexOfDifferences and its test