Command line parameters, Write to file

additionally print percent to console.