Changed TextFile writer to File