Working on stream output code