account for different length of data files