specifying ouput_file, refactored main script in to main()