writing logic for creating a jacobian preconditioner