Some codes on Trees