Implement tracing

I'm so sorry, it's bad code