corrected errors and print to file