backtracking.py addition