Utility Module to clean up and save the D3 input file