adding flag parsing