Add basis for progress indicator. Add detection of end of data.