added new preprocessing function