Tweaked mergeCollection() to make it faster