updated backtrack