modified nesting debug output to allow it to be disabled