added outputting generation and interation to the file sink