BACend pre-processing script