Add Trace function (to be completed)