added support for gzip'ed input files