Write a method, sum which takes an array of numbers and returns the sum of the numbers.