rewrote the newton solver, something is wrong, will start over tomorrow.