added 2nd output type for writer (plain & gzip)