Adding tracing code