Added initial flag parsing