complete preprocessing step