change cout call to stream call