less operations for sum of array