Added bytes read and write output to file