add print func to amittai's tree