further changed preprocess, var scope prob