changed file reading method