debugging tr functions