hopefully this works
scripted update of code from master at 30f879e hopefully this works