added gz flag to infile for proper reading