added tracing routine