adding summation optimization puzzle