More changes towards sudoing from script. Seems to be a stable checkpoint