Fill in the preprocessing function, and everything needed by it.