i think this is the best one with pathfinding compared to other ones
lol i spent 5 hours to find out that for loop was using variable "i" and the function inside the loop was using that too