adding weight_sum_array