tree codes