Extended Preprocess to handle arbitrary inputs (instead of just integers)