Updated with CSV Output

Some whitespace cleanup and inputfile variable name change to inputfile from scandata