Well observed, I was reading the old code and indeed I made that mistake when implementing the path finding algorithm. However you introduced another issue, you cannot clear the searchList, by doing that only the first checked path will be considered, thus the code will not work on mazes.