coding for pre_process