updating sudoku.c - refactoring code