Excellent! I had a feeling you dig diving into some code quality.

### Exploring the problems first.

```
sortedList[mid] + sortedList[mid - 1] / 2.0
return
```

Hold on. You’re not returning anything from the function. Why? You have the work on the line above it. You want to return that. Right?

Same thing here:

```
sortedList[mid]
return
```

#### Problem #2

```
sortedList[mid] + sortedList[mid - 1] / 2.0
```

Think about the Order of Operations in Math. Division takes precedence over addition. Right? For example:

```
print 4 + 2 / 2 # //-> 5 because 2/2 = 1 + 4 = 5
print (4 + 2) / 2 # //-> 3 because 4 + 2 = 6 / 2 = 3
```

#### Problem #3

Why are you subtracting 0.5 to get the middle index when the list has an odd number of items? Go back to the instructions. For example for a list of `[1, 3, 6, 7, 12]`

, the median is 6. It’s the middle index of the list.

Finding the median of [7, 12, 3, 1, 6] would first consist of sorting the sequence into [1, 3, 6, 7, 12] and then locating the middle value, which would be 6.

Think about that one.

### Reusing a middle index

Median in all cases starts with grabbing the middle index, i.e. `middleIndex = numItems / 2`

. You then reuse that `middleIndex`

in 3 different places. Give it a try.

Go ahead and give it a try. I’m here to help.