Changed file reading method.