minor changes to file reading