adding more preprocessing options, fixing a few bugs