code working for all .cfgs