now the output file is of the same type as input file