add some flag parsing