added config file and added some checking. still figuring out how to use a config file the best way