First working draft. Tested with 2 config files