The comment here should describe the behavior and that this is not a realistic example. The behavior is to sum the two numbers to the left and right of an index that represents a pivot. left = sum [i-1, i], right = sum [i+1, i+2]