added backtracking with MRV, MCV function