Refined backtracking algorithm
Done RuleBased