Added some work on the backtracking

Added some work on the backtracking