Actually, in case of a 1 step sync, each match is synchronized after it was processed, so this is called for during the algorithm for each match. Otherwise, if sync is done after the match tree is processed, then there would be an additional iteration, because the call to update flags was done after the recursion. I moved the call so it is actually done right after a match is synchronized.