Added text file input/output support