add stringio for output file read/write