adds method for array summing