Removed debug code,  added support for config file