Dedupe: Improved code on array merging existing data with new data