add implementation of difference and nbDifference