ensure termination
correct the deep merge algorithm to allow array merging