maybe this is right
scripted update of code from master at 2ee95cf maybe this is right