I don't understand what you are doing here, but there are some things which look strange to me:
The outer j loop begins with j=2, you access p_s_t[2, i] -- the first value of p_s_t (j=1) is never used.
The j loop is exited when j = p_s_t_y = 501. The last statement in the loop is inc(j), i.e. the last j value used is p_s_t_y-1 = 500. But the first index of the array p_s_t is dimensioned to run up to p_s_t_y = 501. So, the last value of p_s_t (j=501) is never used either.
Is this intended?