use gflags to control flow