Modified to read the configuration file