Updated functions for solving sudoku