Adding the max_weight as an optional parameter in the configuration file.