use std::pair to maintain tl rng/flag consistency