added write output