structural improvements, added tracing