Update matching function