Sum of numbers in an array function added