added config file for variables and logging
added fine tuned logging and debugging/readability improvements