modified the script for the new config file format