cleaned up printnewton parameter (moved from global variable to input parameter), added m->Write in Opt