Completed data processing code.