added total value of numbers in array function