complements the train_flag branch in mungebits