function [val,H1,C1]=bootbar(S0,m,E,nsim,O,C,H)
%uses the data H,O,C to bootstrap an up and out barrier option with 
%initial value of the stock S0, and upper barrier at m>S0.
H1=[];
C1=[];

for i=1:nsim
   [ON,CN,HN]=boot2(log(S0),log(O),log(C),log(H));
   H1=[H1 exp(max(HN))];
   C1=[C1 exp(CN(length(CN)))];
end
val=(H1<m).*max(C1-E,0);
