You’re getting 120 because you’re asking the tuple for the `sum`

value twice. The tuple passed back is `(min: Int, max: Int, sum: Int)`

. In this case, `sum`

is also index number 2 (`min`

is index zero, `max`

is index one). So in this case `statistics.sum == statistics.2`

If you want to access `min`

or `max`

you can access them using `statistics.min`

or `statistics.max`

respectively. You can also use `statistics.0`

or `statistics.1`

if you prefer (I recommend using the labels though).

Final thought: I would change your initial assignment of `max`

and `min`

inside the function to read as follows:

```
guard var max = scores.first, var min = scores.first else {
return (0, 0, 0)
}
```

This will protect against the user accidentally passing an empty array.

You could have also set min and max to `0`

,not to `scores[0]`

.

This func is very simple, I think you should read somewhere `How functions are working`

.

For loop is used to go through every element, in your case every element in array `scores`

. In every iteration, variable `sum`

is increased by current element in array. So:

At the beginning of the function : `sum = 0`

1. iteration: `sum = 0 + 5`

2. iteration: `sum = 5 + 3`

3. iteration: `sum = 8 + 100`

4. iteration: `sum = 108 + 3`

5. iteration: `sum = 111 + 9`

For loop ends. Sum = `120`

.

Score in Scores means like every single element in score. So name `Score`

can be whatever you want to name it. You could have also name it `element`

, `x`

, `a`

or whatever you like.

The function returns a tuple of type `(min: Int, max: Int, sum: Int)`

.

`max`

and `min`

are not determined before being calculated. When they’re first assigned at the top of the function, they just contain the first element of the passed in `scores`

array. But by the time the loop below finishes, they indeed have the correct minimum and maximum values. Those values are then returned in a tuple matching the return type.