added array merge feature (line 46-50)