Initial implementation of trace functionality