Sudoku Generator in JavaScript