output goes to a stream that does not necessarily have to be stdout