update matchingalgorithm