Text this: An efficient solver for systems of nonlinear equations with singular Jacobian via diagonal updating