Help me improve this algorithm please, as of now it is calulating the rows of Pascal's Triangle but I need it to calculate the colums and stop at (3,1).
for n:= 0 to k do
for m:= 0 to n do
if m=0 or m=n then A[n,m]:= 1
else
A[n,m]:=A[n-1,m-1] + A[n-1,m]