improve 2nd-order derivative method