Updated the data collection code.