switch to using out_stream