backtracking unification