Python: Sudoku working on the grid