add in command line options and cfgfile options.
will debug more details later on