Create Tree code