Необходимо переписать 2 процедуру

Var a:array[1..50,1..50]  of integer;
i,j,f,e,g:integer;
Procedure generaciya;
Begin
Randomize;
writeln('Massiv do sortirovki');
for i:=1 to 5 do {i строка}
begin
for j:=1 to 4 do {j столбец}
begin
a[i,j]:=random(10);
write(a[i,j]:3);
end;
writeln;
end;end;
Procedure sortirovka;
begin
for i:=2 to 5 do
begin
e:=a[i,2];
j:=2;
while e>a[i,j] do
inc(j);
for g:=i-1 downto j do
a[i,g+1]:=a[i,g];
a[i,j]:=e;
end;
end;
Procedure vuvod;
begin
writeln('Massiv posle sortirovki');
for i:=1 to 5 do
begin
for j:=1 to 4 do
begin
write(a[i,j]:3);
end;
writeln;
end;
readln;
end;
begin
generaciya;
sortirovka;
vuvod;
end.


Заранее благодарен