cleaning up compute_jacobian