added code for second tangent computations, and gregory init updates