```
def median(numbers):
length = len(numbers)
if length == 1:
median = numbers[0]
elif length > 1:
numbers.sort()
center = length/2
if length % 2 == 0:
lower = center - 1
#upper = center
median = (numbers[center] + numbers[lower])/2.0
else:
oddcenter = int(center - 0.5)
median = numbers[oddcenter]
return median
```

This works on every other test scenario but I get " "median([6, 8, 12, 2, 23]) returned 6 instead of 8"

Error doesn’t make sense when I work it out.

After sort:

[2,6,8,12,23]

length = 5

center = 2.5

I want index 2 so I do int(center -0.5).

So how is my math different from what python sees?