append, output, and input now corrected for single file input