Implemented trace tracking. Totally untested.