Add merge object logic and orderedSet algorithms