add config file cli option, add a bit of error checking, and improve logging