add preprocess function; not complete yet
more preprocess; not complete