pre-processing (Step1 & 2)