Improved main script, parametrized config file.