encoded the message and added display funct to tree