Added trace functionality