https://www.codecademy.com/courses/python-intermediate-en-rCQKw/2/5?curriculum_id=4f89dab3d788890003000096#

I'm not sure what I am doing wrong, but the error message is "Oops, try again. median([1]) resulted in an error: list index out of range."

I have printed my own list, and it gives back the correct median. Here is my code:

```
def median(sequence):
sequence = sorted(sequence)
ls = len(sequence)
#
if ls > 1:
middle = ls/2
middle_2 = ls/2 - 1
elif ls == 1:
middle = sequence[0]
#Begin calculation of median if even num list
if ls % 2.0 == 0:
center = (sequence[middle] + sequence[middle_2]) / 2.0
else:
center = sequence[middle]
return center
print median([1,2,3,4])
```

Any help is much appreciated! I'm sure/hoping it's a small mistake.