construction from two traversals done