added output file feature