added preprocessing step