added preprocessIDF functionality, also see notes at the end of Preprocess.java