added pre-processing