Updated write function to use the nodes with edited info in the solution.
Added write function to main.
Found incomplete code in File