Updated Code with the output files and input data