Agreed. No idea why I made that global, and certainly no need for it. The only time it's used is from NumberOfWaypoints, which is already passed to the function as an argument. Thanks for catching this.