Adding sum method for a numeric array.