debug pathfinder and add local variables to for loops