more codes about preprocessing