preprocessing step