Bounding Box With point Type
Rather than using arrays of integers, define a type
type point = record
x : integer; -- x coordinate
y : integer; -- y coordinate
end;
var Pts : [1..n] point; -- Points in plane
...
rightedge := max<< Pts.x;
topedge := max<< Pts.y;
leftedge := min<< Pts.x;
bottomedge := min<< Pts.y;
...