The loop on line 149 relied on the standard variable which threw an erro...

...r. A local variable has been added to the loop.