function [ alpha, m, tau ] = SP_Sub5( alpha, G, H, IUP, k, m, NYS, tau, taus, taut)
%sub5 Summary of this function goes here
%   Check for overshooting next surface

if m==NYS
    tau = taut;
else
    if (taut-alpha(m+1))^2-(k(m+1))^2>0
        IUP=2;
        [alpha, m, tau, taut] = SP_Sub34(alpha, G, H, IUP, k, m, NYS, tau, taut);
    else
        tau=taut;
        [alpha, m, tau] = SP_Sub6(alpha, m, tau, taus, taut);
    end

end

