Finish writting function of solving sudoku