Added command line flag parsing