New method for filtering template matches