add gradient and hessian tools