Output, append, and input all work properly with one file