Added an array sum function