Working code for the Newton Solver
Created NewtonCompare.hpp to hold an external global