function [Bk,Hk]=HESSIAN(ddf,Xk)

pt2=Xk(1,1);
pt3=Xk(2,1);
pr2=Xk(3,1);
pr3=Xk(4,1);


Bk=eval(ddf);

[V,D]=eig(Bk);

if (D(1,1)<=0 || D(2,2)<=0 || D(3,3)<=0 || D(4,4)<=0)
    alpha=-1.5*min([D(1,1),D(2,2),D(3,3),D(4,4)]);
    
    Bk=Bk+alpha*eye(length(df));
end

Hk=inv(Bk);