figuring out function, and debuging

Some of my parameter aren't working like i would want them too. also
for loop display garbage in industry file