re-developed stream handling of gzip and stdin