Question: array in proc doesnt sub the values

hello 
i have a long proc i am defining in a loop inside the proc for some reason it calculates the value of a1[j+1] and a2[j+1] and assigns it(in the case of the picture j=1 and in j=2 it doesnt sub) but when it is called again in the next iteration  it doesnt sub the value it just calcluated ! 
i would be so thankful for any help ive been stuck on this for a while now 

Please Wait...