added config file and command line support