function [t,y]=bubpt(t,x,p)
global nc avp bvp
loop=0;
if (loop<=50)
    loop=loop+1;
    sumy=0;
    for j=1:nc
        ps(j)=exp(bvp(j)+avp(j)/(t+460));
        y(j)=ps(j)*x(j)/p;
        sumy=sumy+y(j);
    end
    if(abs(sumy-1)<.00001); return; end
    f=sumy*p-p;
    fslope=0;
    tsq=(t+460)^2;
    for j=1:nc; fslope=fslope-avp(j)*x(j)*ps(j)/tsq; end
    t=t-f/fslope;
else
    error('temp loop');
end
    