Sudoku Solver: previous refactor doesn't work, modify the code to correct version