This version would run much faster if a modification was made for corner movements. Specifically, there is only one way into and out of a corner square. So when you get to C2, the next two moves are always A1 and B3. Or, if you approach from B3, the next two moves are always A1 and C2. In the version shown, you are investigating all the possibilities ignoring this fact, so you spend a huge amount of time investigating paths that lead to nowhere, because you have to do the search for each of the four corners