add tree representation python