added 'sum' utility func