Now using ostreams for output.