Binary tree codes