function [ ret ] = DetermineBoundaryLayer(y, Solution, Inital )
L=length(y);
half=ceil(L/2);
lowerHalf=Solution(1:half);
upperHalf=Solution(half+1:end);
Inital1 = Inital*1.01;
Inital2 = Inital*0.99;
if(Solution(1)>Inital)
    Inital=Inital1;
else
    Inital=Inital2;
end
[lc, lIdx] = min(abs(lowerHalf-Inital));
if(Solution(end)>Inital)
    Inital=Inital1;
else
    Inital=Inital2;
end
[uc, uIdx] = min(abs(upperHalf-Inital));
ret=zeros(2,1);
ret(1)=y(lIdx);
ret(2)=y(uIdx+half);
end

