added constructor for text files