add function to merge arrays and sum keys values