initial data processing code