add streaming output, with test