added another buffer to count computed in the inner loop of pathfinder