It now implements the path_finder function(Backtracking is not necessary)