add ability to write to given output