serialization of BST implemented