added functionality to pass output file name