Add pre_trace() and pred_trace() functions