Added optional command-line to specify input/output

Also cleared out some trailing whitespace :)