finish tree and node's fucntion