Added configuration file and improved debugging output