changed file i/o

changed file i/o