Combining two text file functionality