Removed unused includes.
Made Gsave() faster by not having to calculate the number of nodes