added some more preprocessing functions