some messing around
scripted update of code from master at 5a7627e some messing around