flexible backtracking