use empty accum instead of new empty array