function vertices = bounding_box(M)

% Find highest x value
hix = M(1,2); 
for i = i:size(M,1)
   if (M(i,2)>hix)
      hix=M(i,2)
   end
end

% Find lowest x value
lox = M(1,2); 
for i = i:size(M,1)
   if (M(i,2)<lox)
      lox=M(i,2)
   end
end

% Find highest y value
hiy = M(1,3); 
for i = i:size(M,1)
   if (M(i,3)>hiy)
      hiy=M(i,2)
   end
end

% Find lowest y value
loy = M(1,3); 
for i = i:size(M,1)
   if (M(i,3)<loy)
      loy=M(i,3)
   end
end

% Find highest z value
hiz = M(1,4); 
for i = i:size(M,1)
   if (M(i,4)>hiz)
      hiz=M(i,4)
   end
end

% Find lowest z value
loz = M(1,4); 
for i = i:size(M,1)
   if (M(i,4)<loz)
      loz=M(i,4)
   end
end

% Eight Corners
vertices = [hix, hiy, hiz;hix, hiy, loz;hix, loy, hiz;hix, loy, loz;lox, hiy, hiz;lox, hiy, loz;lox, loy, hiz;lox, loy, loz];
