Built Backtracking Method

hopefully it will work