Added ability to choose output file name.