added array comparison + merge