fixed some minor typos, modified ToVec, Newton iteration finally works!