function g = expst(dmin,a,b,z,n,alp0)
m=length(z);
if z(1) ==a & z(m)~=b;

  for i=1:m-1;
   
   x  = expstret(dmin(i),z(i),.5*(z(i)+z(i+1)),.5*(n(i)+1)+1,alp0(i));
   g  = [g;x(1:length(x))];

   x  = expstret(dmin(i),0,.5*(z(i+1)-z(i)),.5*(n(i)+1)+1,alp0(i));
   x  = z(i+1)-x(.5*(n(i)+1):-1:2);
   g  = [g;x];

 end;
 x  = expstret(dmin(m),z(m),b,n(m)+2,alp0(m));
 g  = [g;x(1:length(x))];
end;


if z(1) ~=a & z(m)~=b;

  x  = expstret(dmin(1),0,z(1)-a,n(1)+2,alp0(1));
  x  = z(1)-x(n(1)+2:-1:1);
  g  = x;
  for i=1:m-1;
   
   x  = expstret(dmin(i+1),z(i),.5*(z(i)+z(i+1)),.5*(n(i+1)+1)+1,alp0(i+1));
   g  = [g;x(2:length(x))];

   x  = expstret(dmin(i+1),0,.5*(z(i+1)-z(i)),.5*(n(i+1)+1)+1,alp0(i+1));
   x  = z(i+1)-x(.5*(n(i+1)+1):-1:1);
   g  = [g;x];

 end;
 x  = expstret(dmin(m+1),z(m),b,n(m+1)+2,alp0(m+1));
 g  = [g;x(2:length(x))];
end;
