rewrote tracing to allow a function to trace during evaluation