before implementing backtracking