Script rewritten to setConfigEntry(), getConfig() and incrementConfigEntry()