Working on modified multidim Newton-Raphson