function [blue] = blue(r,sigma,t,S,T,E,eta,ti,green)
%Returns a solution to Black-Scholes on [0,T1]x[Ee^(-m^2),Ee^(m^2)], with 
%stepsizes (2/sigma1^2*ti) and unequal steps, Ee^(-m^2+((j-1)/eta))), for 
%1\leq j\leq 2*m^2*eta+1.
l=(2*r)/(sigma)^2;
z=log(eta);
m=z^0.25;
square=m^2;
quart=m^4;
a=2*m*eta;
b=rem(a,1);
steps1=a-b;
nsteps1=steps1+1;
c=2*square*eta;
d=rem(c,1);
steps2=c-d;
nsteps2=steps2+1;
stepsize=1/eta;
steps3=ti^2;
nsteps3=steps3+1;
stepsizeti=1/ti;
x=linspace(-m,m,nsteps1);
l=(2*r)/sigma^2;
u=green(3,:,:);
a=size(u);
a2=a(2);
a3=a(3);
for (i=1:a2)
    for (j=1:a3)
        op(i,j)=u(1,i,j);

    end
end
w1=rem(sigma,stepsizeti);
sigma1=sigma-w1;
v=2/(sigma^2*ti);
w=rem(T,v);
T1=T-w;
k1u=(0.5*ti*sigma^2*T1);
k1=round(k1u);
steps4=T1/v;
nsteps4u=steps4+1;
nsteps4=round(nsteps4u);
for (j=1:nsteps2)
    s(j)=(-square*eta+(j-1))*stepsize;
    for (t=1:nsteps4)
        denum(t,j)=exp(0.5*(l-1)*s(j))*exp(T-2*stepsize*(t-1));
        num(t,j)=E*op(k1-t+2,j);
        V(t,j)=num(t,j)/denum(t,j);
    end
end
for (a=1:3)
    for (t=1:nsteps4)
        for (j=1:nsteps2)
    if (a==1)
        blue(a,t,j)=0;
    elseif (a==2)
        blue(a,t,j)=0;
    else
        blue(a,t,j)=V(t,j);
    
    end
end


end
end

end


