Added text file and open file function