moving low level debug code to more appropriate location
scripted update of code from master at 6cb47a8 moving low level debug code to more appropriate location