settings dynamic variables with angular
add function to merge arrays and sum keys values