code to read data files