finish preprocessing.