serialization wip, seems that it is needed to turn all terminal nodes into one