Break out output file name to function. Update terminal output