changed it to write to a specific output file