Completed the tracing logic. Currently it only outputs the tracing results to stdout.