rename outputs and deals with gzips