Add feature to change output file name

Please check this code!