added a new legal function to Sudoku