added code to pipe output to gzip