update N_Queens with explicit backtracking