more work on template debugging