master: adding array sum function