finish the improved face matching algorithm